﻿<Window x:Class="StackHash.SelectPlugins"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Select Plugins - StackHash" Height="300" MinHeight="300" Width="400" MinWidth="400" Icon="/StackHash;component/StackHash.ico" ShowInTaskbar="False" WindowStartupLocation="CenterOwner" Closed="Window_Closed">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="MasterResources.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Window.CommandBindings>
        <CommandBinding Command="Help" x:Name="commandBindingHelp" Executed="commandBindingHelp_Executed" />
    </Window.CommandBindings>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <TextBlock Margin="10,10,10,0" TextWrapping="Wrap">
            Select one or more plugins to synchronize and click OK. StackHash will send all 
            products, events, cab information, notes and script results to the selected plugins. This 
            may take some time to complete.
        </TextBlock>

        <ListView Grid.Row="1" Margin="10,7,10,10" Name="listViewPlugins" SelectionMode="Single" GridViewColumnHeader.Click="listViewPlugins_Click">
            <ListView.ItemContainerStyle>
                <Style TargetType="ListViewItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                </Style>
            </ListView.ItemContainerStyle>
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="100">
                        <GridViewColumnHeader Tag="Selected" Content="Synchronize" />
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox IsChecked="{Binding Selected, Mode=TwoWay}" HorizontalAlignment="Center" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" />
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Width="200">
                        <GridViewColumnHeader Tag="Name" Content="Plugin Name" />
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Name}" HorizontalAlignment="Left" />
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>

        <Border Grid.Row="2" Style="{StaticResource ButtonBorder}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Button Margin="10" Command="Help">_Help</Button>

                <StackPanel Margin="7" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button Margin="3" Name="buttonOK" IsDefault="True" Click="buttonOK_Click">OK</Button>
                    <Button Margin="3" IsCancel="True">Cancel</Button>
                </StackPanel>
            </Grid>
        </Border>

    </Grid>
</Window>
